package tt.dz.egobus.servicemanager.service.impl;

import org.quartz.SchedulerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tt.dz.egobus.servicemanager.core.task.QuartzTaskManagerImpl;

/**
 * @author Anson
 * @date 17-8-8
 * @name spring管理的动态任务管理器
 * @since 1.0.6
 */
@Service("springQuartzTaskManagerImpl")
public class SpringQuartzTaskManagerImpl extends QuartzTaskManagerImpl {


    private static final String DEFAULT_JOB_GROUP_NAME = "DEFAULT_JOB_GROUP";
    private static final String DEFAULT_TRIGGER_GROUP_NAME = "DEFAULT_TRIGGER_GROUP";

    @Autowired
    private SchedulerFactory schedulerFactory;

    @Override
    protected SchedulerFactory getSchedulerFactory() {
        return schedulerFactory;
    }

    @Override
    protected String getDefaultJobGroupName() {
        return DEFAULT_JOB_GROUP_NAME;
    }

    @Override
    protected String getDefaultTriggerGroupName() {
        return DEFAULT_TRIGGER_GROUP_NAME;
    }
}
